package com.example.consumer;

//import com.example.services.UserServices;

import com.example.rpc_core.model.User;
import com.example.provider.services.UserServices;
import com.example.rpc_core.proxy.ServerProxyFactory;

public class EasyConsumer {
    public static void main(String[] args) {
        // 动态代理
        User user=new User();
        user.setName("张三");
        UserServices proxy = ServerProxyFactory.getProxy(UserServices.class);
        User user1 = proxy.getUser(user);
        if (user1 != null){
        System.out.println(user1);}
        else {
            System.out.println("user1==null");
        }
        int count = proxy.getCount();
        System.out.println(count);

    }
}